﻿using Linguist.Language.Grammar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Linguist.Flat
{
    /// <summary>
    /// Represents a non-emitting sentence hmm state
    /// </summary>
    public class GrammarState : SentenceHMMState
    {
         private GrammarNode grammarNode;

        /**
        /// Creates a GrammarState
         *
        /// @param node the GrammarNode associated with this state
         */
        public GrammarState(GrammarNode node) 
            :base("G", null, node.getID())
        {
            this.grammarNode = node;
            setFinalState(grammarNode.isFinalNode());
        }


        /**
        /// Gets the grammar node associated with this state
         *
        /// @return the grammar node
         */
        public GrammarNode getGrammarNode() 
        {
            return grammarNode;
        }


        /**
        /// Retrieves a short label describing the type of this state. Typically, subclasses of SentenceHMMState will
        /// implement this method and return a short (5 chars or less) label
         *
        /// @return the short label.
         */
        public String getTypeLabel() 
        {
            return "Gram";
        }


        /**
        /// Returns the state order for this state type
         *
        /// @return the state order
         */
        override public int getOrder() 
        {
            return 3;
        }
    }
}
